package com.example.demo2_review.design_pattern.structural_patterns.decorator_pattern;

/**
 * @Author zwp14
 * @create 2024/6/25 0:30
 * @description 使用装饰器模式
 */
public class DecoratorPatternDemo {
    public static void main(String[] args) {
        //创建实现绘画功能的画圆对象
        Shape circle = new Circle();
        //创建继承装饰器的对象，并传递绘画者
        Shape redCircle = new RedShapeDecorator(new Rectangle());

        System.out.println("Circle with normal border");
        circle.draw();

        System.out.println("Circle of red border");
        redCircle.draw();
    }
}
